import sqlite3
import a_总排行
import a_股票型排行
import a_混合型排行
import a_债券型排行
import a_指数型排行
import a_基金历史净值
import wordCloud
import wordCloudLeft

if __name__ == '__main__':
    try:
        a_总排行.Ranking()
    except Exception as result1:
        print('总排行爬取时出错：:',result1)
    try:
        a_股票型排行.GuPiaoRanking()
    except Exception as result2:
        print('股票型排行爬取时出错：:',result2)
    try:
        a_混合型排行.HunHeRanking()
    except Exception as result3:
        print('混合型排行爬取时出错：:',result3)
    try:
        a_债券型排行.ZhaiQuanRanking()
    except Exception as result4:
        print('债券型排行爬取时出错：:',result4)
    try:
        a_指数型排行.ZhiShuRanking()
    except Exception as result5:
        print('指数型排行爬取时出错：:',result5)
    try:
        for num in range(1, 2):
            a_基金历史净值.get_fund_ranking(num)
    except Exception as result6:
        print('基金历史净值爬取时出错：:',result6)
    try:
        wordCloud.wordCloud()
    except Exception as result7:
        print('右词云生成时爬取时出错：:', result7)
    try:
        wordCloudLeft.wordCloudLeft()
    except Exception as result8:
        print('左词云生成时出错爬取时出错：:', result8)
    finally:
        conn = sqlite3.connect("fundDB.db")
        conn.close()
